package com.example.mac.zyfypt_314wmy.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.example.mac.zyfypt_314wmy.R;

public class LoginActivity extends AppCompatActivity implements View.OnClickListener {

    private TextView tv1, tvname,tvmima, tvhuanying, tvlogin;
    private Button btlogin, btreg;
    private EditText et1, et2;

    public LoginActivity() {
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        //Toast.makeText(this,"登录",Toast.LENGTH_SHORT).show();
        init();
    }

    private void init() {

        tv1 = (TextView) findViewById(R.id.textView);
        tvhuanying = (TextView) findViewById(R.id.textView2);
        tvlogin = (TextView) findViewById(R.id.textView3);
        tvname = (TextView) findViewById(R.id.textView4);
        tvmima= (TextView) findViewById(R.id.textView11);

        btlogin=(Button)findViewById(R.id.button);
        btreg=(Button)findViewById(R.id.button2);

        et1=(EditText)findViewById(R.id.editText);
        et2=(EditText)findViewById(R.id.editText2);

        btlogin.setOnClickListener(this);
        btreg.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.button:
                Intent intent = new Intent(LoginActivity.this, MainActivity.class);
                startActivity(intent);
                break;
            case R.id.button2:
                Intent intent1 = new Intent(LoginActivity.this, RegisterActivity.class);
                startActivity(intent1);
                break;
        }
    }

}
